package definedException;

//文件名称 BankDemo.java
public class BankDemo
{
    public static void main(String [] args)
    {
        CheckingAccount c = new CheckingAccount(101);
        System.out.println("存贮 $500...");
        c.deposit(500.00);
        try
        {
            System.out.println("\n提款 $100...");
            c.withdraw(100.00);
            System.out.println("\n提款 $600...");
            c.withdraw(600.00);
        }catch(InsufficientFundsException e)
        {
            System.out.println("对不起，但是你余额还差" + e.getAmount());
            System.out.println(c.getBalance());
            e.printStackTrace();
        }
    }
}